package com.huawei.appgallery.forum.section.fragment;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TabHost.TabSpec;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.huawei.appgallery.forum.base.card.bean.Section;
import com.huawei.appgallery.forum.base.https.jgw.JGWTabDetailResponse;
import com.huawei.appgallery.forum.base.https.jgw.JGWTabInfo;
import com.huawei.appgallery.forum.cards.card.ForumPostCard;
import com.huawei.appgallery.forum.section.api.ISectionDetailActivityResult;
import com.huawei.appgallery.forum.section.api.ISectionTabFragmentProtocol;
import com.huawei.appgallery.forum.section.bean.ForumNoticeCardBean;
import com.huawei.appgallery.forum.section.bean.ForumSectionEnterCardBean;
import com.huawei.appgallery.forum.section.bean.ForumSectionHeadCardBean;
import com.huawei.appgallery.forum.section.card.ForumNoticeCard;
import com.huawei.appgallery.forum.section.card.ForumSectionEnterCard;
import com.huawei.appgallery.forum.section.card.ForumSectionHeadCard;
import com.huawei.appgallery.forum.section.impl.ForumSectionDetailActivity;
import com.huawei.appgallery.forum.section.node.ForumNoticeNode;
import com.huawei.appgallery.forum.section.node.ForumSectionEnterNode;
import com.huawei.appgallery.forum.section.view.widget.SectionDetailSubHead;
import com.huawei.appgallery.forum.section.view.widget.SectionNestScrollLayout;
import com.huawei.appgallery.forum.section.view.widget.SectionNestScrollLayout.c;
import com.huawei.appgallery.foundation.account.bean.UserSession;
import com.huawei.appgallery.foundation.ui.css.CSSRule;
import com.huawei.appgallery.foundation.ui.css.CSSSelector;
import com.huawei.appgallery.foundation.ui.css.CSSStyleSheet;
import com.huawei.appgallery.foundation.ui.css.CSSView;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.BaseListFragment;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.foundation.ui.framework.uikit.ContractFragment;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.appmarket.support.widget.tabhost.FragmentTabHost;
import com.huawei.hms.framework.network.restclient.hwhttp.route.IPRoute;
import com.huawei.secure.android.common.intent.SafeBroadcastReceiver;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import o.azb;
import o.bqw;
import o.bqx;
import o.bqy;
import o.bre;
import o.bsd;
import o.bsv;
import o.bya;
import o.byd;
import o.byj;
import o.cab.i;
import o.cab.j;
import o.car;
import o.cat;
import o.cau;
import o.cav;
import o.cax;
import o.cay;
import o.AccountBussinessListener;
import o.ccp;
import o.chb;
import o.cia;
import o.cir;
import o.ciy;
import o.ciz;
import o.cjk;
import o.cjm;
import o.cvt;
import o.doo;
import o.eoj;
import o.ActivityUtil;
import o.evk;
import o.ewk;
import o.fho;
import o.fiu;
import o.fjb;
import o.fjf;
import o.fjm;
import o.fjo;
import o.fjq;
import o.FragmentManager;
import o.FragmentTransaction;
import o.ll;

public class ForumSectionDetailFragment extends ContractFragment implements com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment.e, c, com.huawei.appgallery.forum.section.view.widget.SectionDetailSubHead.d, AccountBussinessListener, com.huawei.appgallery.forum.section.fragment.SectionLoadingFragment.d, com.huawei.appgallery.forum.section.card.ForumSectionHeadCard.a {
    private static final Object ˋʼ = new Object();
    public static final String ˎ = (bqy.ˋ().ˏ().getPackageName() + ".forum.section.recentaccess.action");
    protected String ʹ;
    protected String ʻˊ;
    private int ʻˋ;
    protected long ʻᐝ;
    protected FragmentTabHost ʼ;
    private ForumSectionHeadCardBean ʼˊ;
    protected String ʼˋ;
    private SectionDetailSubHead ʼᐝ;
    protected cay ʽ;
    private LinearLayout ʽˊ;
    private List<ForumNoticeCardBean> ʽˋ;
    private List<JGWTabInfo> ʽᐝ;
    private ForumSectionEnterCardBean ʾॱ;
    private LayoutInflater ʿॱ;
    private View ˈॱ;
    private int ˉॱ;
    protected int ˊ = 0;
    private cav ˊʻ;
    private e ˊʼ;
    private final BroadcastReceiver ˊʽ = new a();
    protected ImageView ˋ;
    private ViewGroup ˋʻ;
    private d ˋʽ;
    private Handler ˌॱ = new Handler();
    private int ˎͺ = 0;
    protected String ˏ;
    private SectionLoadingFragment ˏͺ;
    private int ˑॱ = -1;
    private List<WeakReference<ForumSectionTabFragment>> ͺˎ = new ArrayList();
    private boolean ͺˏ = false;
    protected SectionNestScrollLayout ॱ;
    protected FrameLayout ॱॱ;
    protected BaseListFragment.c ᐝ;
    protected String ﹳ;
    protected long ﾞ = 0;
    protected int ﾟ;

    static final class a extends SafeBroadcastReceiver {
        private a() {
        }

        public void onReceiveMsg(Context context, Intent intent) {
            if (ForumPostCard.ˊ.equals(intent.getAction()) && UserSession.getInstance().isLoginSuccessful()) {
                try {
                    long longExtra = intent.getLongExtra("post_id", -1);
                    if (-1 != longExtra) {
                        car.ˏ().ॱ(longExtra);
                    }
                } catch (Throwable e) {
                    bqx.ˊ("ForumSectionDetailFragment", "SECTION_POST_READ_ACTION error", e);
                }
            }
        }
    }

    static class b implements Runnable {
        private WeakReference<ForumSectionDetailFragment> ॱ;

        public b(ForumSectionDetailFragment forumSectionDetailFragment) {
            this.ॱ = new WeakReference(forumSectionDetailFragment);
        }

        public void run() {
            ForumSectionDetailFragment forumSectionDetailFragment = (ForumSectionDetailFragment) this.ॱ.get();
            if (forumSectionDetailFragment != null) {
                synchronized (ForumSectionDetailFragment.ˋʼ) {
                    long currentTimeMillis = System.currentTimeMillis();
                    if (forumSectionDetailFragment.ﾞ == 0 || currentTimeMillis - forumSectionDetailFragment.ﾞ >= 2000) {
                        forumSectionDetailFragment.ﾞ = currentTimeMillis;
                        cat.ˋ().ॱ();
                        car.ˏ().ˋ();
                        forumSectionDetailFragment.ˏͺ();
                        return;
                    }
                    bqx.ˊ("ForumSectionDetailFragment", "onAccountBusinessResult, account interval too short.");
                }
            }
        }
    }

    public interface d {
        void ˊ(String str);

        void ˏ(String str, int i);
    }

    class e extends ewk {
        final /* synthetic */ ForumSectionDetailFragment ˊ;

        public e(ForumSectionDetailFragment forumSectionDetailFragment) {
            this.ˊ = forumSectionDetailFragment;
        }

        public int ˎ() {
            return this.ˊ.ʽᐝ.size();
        }

        public Fragment ˎ(int i) {
            Fragment fragment = null;
            fjb ˎ = fho.ˏ().ˋ("Section").ˎ("ForumSectionTabFragment");
            if (!(ˎ == null || this.ˊ.ॱˊ() == null)) {
                ISectionTabFragmentProtocol iSectionTabFragmentProtocol = (ISectionTabFragmentProtocol) ˎ.ˊ();
                iSectionTabFragmentProtocol.setSupportNetworkCache(true);
                String ˊ = new cau().ˊ((JGWTabInfo) this.ˊ.ʽᐝ.get(i), this.ˊ.ʻˋ);
                iSectionTabFragmentProtocol.setUri(ˊ);
                iSectionTabFragmentProtocol.setFragmentID(ˊ.hashCode());
                iSectionTabFragmentProtocol.setTabStyle(chb.SECONDARY_LIST_TAB);
                iSectionTabFragmentProtocol.setStyle(this.ˊ.ﾟ);
                iSectionTabFragmentProtocol.setCss(this.ˊ.ﹳ);
                iSectionTabFragmentProtocol.setCssSelector(this.ˊ.ʹ);
                iSectionTabFragmentProtocol.setDomainId(this.ˊ.ʻˊ);
                iSectionTabFragmentProtocol.setAppId(this.ˊ.ʼˋ);
                iSectionTabFragmentProtocol.setNoObserverAccount(true);
                iSectionTabFragmentProtocol.setIsDelayShowLoading(true);
                fragment = fjm.ˏ(fiu.ˊ().ˋ(this.ˊ.ॱˊ(), ˎ)).ˏ();
            }
            if (fragment != null) {
                return fragment;
            }
            fragment = new Fragment();
            bqx.ॱ("ForumSectionDetailFragment", "getItem error new Fragment(), position = " + i);
            return fragment;
        }

        public void ˏ(int i, Fragment fragment, Fragment fragment2) {
            if (fragment instanceof ForumSectionTabFragment) {
                if (fragment instanceof ciy) {
                    ((ciy) fragment).ˋ(i);
                }
                ForumSectionTabFragment forumSectionTabFragment = (ForumSectionTabFragment) fragment;
                Object obj = null;
                for (WeakReference weakReference : this.ˊ.ͺˎ) {
                    Object obj2;
                    ForumSectionTabFragment forumSectionTabFragment2 = (ForumSectionTabFragment) weakReference.get();
                    if (forumSectionTabFragment2 == null || !forumSectionTabFragment.equals(forumSectionTabFragment2)) {
                        obj2 = obj;
                    } else {
                        obj2 = 1;
                    }
                    obj = obj2;
                }
                if (obj == null) {
                    this.ˊ.ͺˎ.add(new WeakReference(forumSectionTabFragment));
                }
            }
            if (fragment2 instanceof ciy) {
                ((ciy) fragment2).ʽˊ();
            }
            this.ˊ.ˎͺ = i;
        }

        public boolean ˎ(int i, TabSpec tabSpec) {
            if (!(this.ˊ.ʽᐝ == null || this.ˊ.ʽᐝ.isEmpty())) {
                JGWTabInfo jGWTabInfo = (JGWTabInfo) this.ˊ.ʽᐝ.get(i);
                if (jGWTabInfo != null) {
                    tabSpec.setIndicator(jGWTabInfo.ᐝ());
                    return true;
                }
            }
            return false;
        }

        public String ˊ(int i) {
            if (!(this.ˊ.ʽᐝ == null || this.ˊ.ʽᐝ.isEmpty())) {
                JGWTabInfo jGWTabInfo = (JGWTabInfo) this.ˊ.ʽᐝ.get(i);
                if (jGWTabInfo != null) {
                    return jGWTabInfo.ʼ();
                }
            }
            return String.valueOf(i);
        }
    }

    public void ˏ(Bundle bundle) {
        bre.ॱ.ॱ("time_0001_");
        c_(true);
        super.ˏ(bundle);
        eoj.ˋ().ˎ("ForumSectionDetailFragment", this);
        ˎ(bundle);
        ʾॱ();
        if (this.ᐝ != null) {
            cia ॱ = this.ᐝ.ॱ(this.ˊ);
            if (ॱ instanceof cay) {
                this.ʽ = (cay) ॱ;
            }
        }
    }

    protected void ˎ(Bundle bundle) {
        try {
            Bundle ˊॱ = ˊॱ();
            this.ˏ = ˊॱ.getString("key_uri", this.ˏ);
            this.ʼˋ = ˊॱ.getString("key_appid");
            this.ʻˊ = ˊॱ.getString("key_domainid");
        } catch (Exception e) {
            bqx.ˋ("ForumSectionDetailFragment", "init data exception");
        }
        if (bundle != null) {
            this.ˑॱ = bundle.getInt("save_bundle_key_lastScroll");
            this.ˎͺ = bundle.getInt("save_bundle_key_lastTab", 0);
            this.ʻˊ = bundle.getString("save_bundle_key_domainId", this.ʻˊ);
        }
    }

    private void ʾॱ() {
        try {
            this.ʻˋ = Integer.parseInt(new cau().ˎ(this.ˏ));
        } catch (Exception e) {
            bqx.ˋ("ForumSectionDetailFragment", "get sectionId error");
        }
    }

    public void ॱ(Activity activity) {
        super.ॱ(activity);
        if (activity instanceof cav) {
            this.ˊʻ = (cav) activity;
        }
        if (activity instanceof BaseListFragment.c) {
            this.ᐝ = (BaseListFragment.c) activity;
        }
        if (activity instanceof d) {
            this.ˋʽ = (d) activity;
        }
    }

    @Nullable
    public View ˋ(@NonNull LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, @Nullable Bundle bundle) {
        this.ʿॱ = layoutInflater;
        this.ˋʻ = viewGroup;
        ViewGroup viewGroup2 = (ViewGroup) layoutInflater.inflate(i.ˏॱ, viewGroup, false);
        ॱ(viewGroup2);
        ʽᐝ();
        if (this.ʽ == null) {
            ʽˊ();
        } else {
            ͺˎ();
        }
        return viewGroup2;
    }

    private void ʽˊ() {
        if (ॱˋ() != null && ʾ()) {
            Fragment ˊ = cjk.ˎ().ˊ(new cjm("section_loading_title_.fragment", null));
            if (ˊ instanceof SectionLoadingFragment) {
                this.ˏͺ = (SectionLoadingFragment) ˊ;
                this.ˏͺ.ˊ(this);
                this.ˏͺ.ˊ(this);
                FragmentManager י = י();
                if (י != null) {
                    this.ˏͺ.ˋ(י, o.cab.e.ꓸ, "ForumSectionDetailFragment-LOADING");
                } else {
                    bqx.ˋ("ForumSectionDetailFragment", "showLoading manager null");
                }
            }
        }
    }

    private void ˉॱ() {
        this.ˈॱ.setVisibility(8);
        this.ॱ.setVisibility(0);
        ᐝ(0);
        ˊʻ();
        ʼᐝ();
        ˊ(this.ʿॱ);
        car.ˏ().ˎ();
        if (this.ˑॱ > 0) {
            this.ॱ.ˋ(this.ˑॱ, IPRoute.INTERVAL);
        }
    }

    protected void ᐝ(int i) {
        if (this.ˋ != null) {
            this.ˋ.setVisibility(i);
        }
    }

    protected void ʽᐝ() {
        ll.ˏ(bqy.ˋ().ˏ()).ˏ(this.ˊʽ, new IntentFilter(ForumPostCard.ˊ));
    }

    private void ˈॱ() {
        ll.ˏ(bqy.ˋ().ˏ()).ˋ(this.ˊʽ);
    }

    private void ॱ(ViewGroup viewGroup) {
        this.ˈॱ = viewGroup.findViewById(o.cab.e.ꓸ);
        this.ॱ = (SectionNestScrollLayout) viewGroup.findViewById(o.cab.e.ᶥ);
        this.ʽˊ = (LinearLayout) viewGroup.findViewById(o.cab.e.ꜞ);
        this.ʼᐝ = (SectionDetailSubHead) viewGroup.findViewById(o.cab.e.ﾟ);
        azb.ˏ(this.ʼᐝ);
        this.ʼ = (FragmentTabHost) viewGroup.findViewById(16908306);
        this.ॱॱ = (FrameLayout) viewGroup.findViewById(o.cab.e.ˋˋ);
        this.ʼ.setup(ॱˋ(), י(), o.cab.e.ˋˋ);
        this.ʼ.setForbidTabDestroyed(true);
        this.ʼᐝ.setTabHost(this.ʼ);
        this.ʼᐝ.setSpinnerClickLisenter(this);
        ˎ(viewGroup);
    }

    protected void ˎ(ViewGroup viewGroup) {
        this.ˋ = (ImageView) viewGroup.findViewById(o.cab.e.ꜟ);
        azb.ˎ(this.ˋ);
        this.ˋ.setOnClickListener(new OnClickListener(this) {
            final /* synthetic */ ForumSectionDetailFragment ˋ;

            {
                this.ˋ = r1;
            }

            public void onClick(View view) {
                this.ˋ.ˊʼ();
            }
        });
    }

    private void ˊʻ() {
        if (this.ʽᐝ != null && this.ʽᐝ.size() > 0) {
            this.ˊʼ = new e(this);
            this.ʼ.setAdapter(this.ˊʼ);
            if (this.ͺˏ) {
                this.ͺˏ = false;
                for (WeakReference weakReference : this.ͺˎ) {
                    ForumSectionTabFragment forumSectionTabFragment = (ForumSectionTabFragment) weakReference.get();
                    if (forumSectionTabFragment != null) {
                        forumSectionTabFragment.ˎͺ();
                    }
                }
            }
            if (this.ˎͺ < 0 || this.ˎͺ >= this.ʽᐝ.size()) {
                this.ʼ.setCurrentTab(0);
            } else {
                this.ʼ.setCurrentTab(this.ˎͺ);
            }
        }
    }

    protected void ʼᐝ() {
        this.ॱ.ॱ = this.ʽˊ;
        this.ॱ.ˏ = this.ʼᐝ;
        this.ॱ.ˎ = this.ॱॱ;
        this.ॱ.setOnScrollListener(this);
        this.ॱ.setImmerse(true);
    }

    private void ˊ(LayoutInflater layoutInflater) {
        this.ʽˊ.removeAllViews();
        if (!(this.ʼˊ == null || this.ˏ.startsWith("forum|forum_detail_app"))) {
            ForumSectionHeadCard forumSectionHeadCard = new ForumSectionHeadCard(ॱˋ());
            View ˋ = forumSectionHeadCard.ˋ(layoutInflater);
            forumSectionHeadCard.ˏ((com.huawei.appgallery.forum.section.card.ForumSectionHeadCard.a) this);
            forumSectionHeadCard.ˏ(this.ʼˊ);
            this.ʽˊ.addView(ˋ);
            this.ॱ.setImmerseView(ˋ);
        }
        boolean ˋʻ = ˋʻ();
        ͺ(ˋʻ);
        if (ˋʻ) {
            ˌॱ();
        }
        ˎ(this.ʽˊ);
        if (this.ʽᐝ == null || this.ʽᐝ.size() <= 0) {
            this.ʼᐝ.setVisibility(8);
            return;
        }
        if (this.ﾟ == 1) {
            this.ʼᐝ.setImmer(true);
            ˎ(this.ʼᐝ);
        }
        this.ʼᐝ.ˎ(ॱˋ(), this.ʽᐝ, ˋʻ, this.ˎͺ);
        for (int i = 0; i < this.ʽᐝ.size(); i++) {
            if ("forum|forum_detail_all".equals(((JGWTabInfo) this.ʽᐝ.get(i)).ʼ())) {
                this.ˉॱ = i;
            }
        }
    }

    private boolean ˋʻ() {
        if (this.ʽˋ != null) {
            for (ForumNoticeCardBean forumNoticeCardBean : this.ʽˋ) {
                if (forumNoticeCardBean != null) {
                    List ˊ = forumNoticeCardBean.ˊ();
                    if (ˊ != null && ˊ.size() > 0) {
                        return true;
                    }
                }
            }
        }
        return false;
    }

    private void ͺ(boolean z) {
        if (this.ʾॱ != null) {
            ForumSectionEnterNode forumSectionEnterNode = new ForumSectionEnterNode(ॱˋ());
            forumSectionEnterNode.ˊ(this.ʽˊ, null);
            ForumSectionEnterCard ˎ = forumSectionEnterNode.ˎ();
            if (ˎ != null) {
                ˎ.ˎ(z);
                ˎ.ˏ(this.ʾॱ);
            }
        }
    }

    private void ˌॱ() {
        if (this.ʽˋ != null) {
            for (CardBean cardBean : this.ʽˋ) {
                if (cardBean != null) {
                    List ˊ = cardBean.ˊ();
                    if (!(ˊ == null || ˊ.size() == 0)) {
                        ForumNoticeNode forumNoticeNode = new ForumNoticeNode(ॱˋ());
                        forumNoticeNode.ˊ(this.ʽˊ, null);
                        ForumNoticeCard ᐝ = forumNoticeNode.ᐝ();
                        if (ᐝ != null) {
                            ᐝ.ˏ(cardBean);
                        }
                    }
                }
            }
        }
    }

    public boolean ॱ() {
        if (!(this.ˊʼ == null || this.ʼ == null)) {
            Fragment ॱ = this.ʼ.ॱ();
            if (ॱ instanceof ciz) {
                return ((ciz) ॱ).ad_();
            }
            bqx.ॱ("ForumSectionDetailFragment", "unknown type, fragment:" + ॱ + ", uri:");
        }
        return false;
    }

    public void ˏ(int i, int i2) {
        this.ˑॱ = i;
        if (this.ˊʻ != null) {
            this.ˊʻ.ˎ(i, i2);
        }
    }

    public void ॱ(String str, String str2) {
        cat.ˋ().ˎ(str, str2);
        if (!doo.ˊ(ॱˋ()) || this.ʼ == null) {
            evk.ˋ(ॱˋ(), ॱ(j.ˈ), 0).ˋ();
            return;
        }
        ForumSectionTabFragment forumSectionTabFragment = (ForumSectionTabFragment) this.ʼ.ॱ();
        if (forumSectionTabFragment != null) {
            forumSectionTabFragment.ʽ(new cau().ˎ(str, this.ʻˋ, str2));
            forumSectionTabFragment.ˎͺ();
        }
    }

    public void ˊʼ() {
        if (bsd.ॱ(this.ʻᐝ)) {
            evk.ˏ(ॱˊ(), j.ˊ, 0).ˋ();
            return;
        }
        Context ॱˋ = ॱˋ();
        if (ॱˋ != null) {
            int ˋ;
            bya o_bya = (bya) fho.ˏ().ˋ("Option").ॱ(bya.class);
            byd o_byd = new byd(this.ʻˋ);
            if (this.ʼˊ != null) {
                Section ˊ = this.ʼˊ.ˊ();
                if (ˊ != null) {
                    ˋ = ˊ.ˋ();
                    o_bya.ˏ(this.ʻˊ, ॱˋ, false, o_byd, ˋ).ˏ(new fjq<byj>(this) {
                        final /* synthetic */ ForumSectionDetailFragment ˋ;

                        {
                            this.ˋ = r1;
                        }

                        public void onComplete(fjo<byj> o_fjo_o_byj) {
                            if (o_fjo_o_byj.ˊ()) {
                                byj o_byj = (byj) o_fjo_o_byj.ॱ();
                                if (o_byj.ˊ() == -1) {
                                    byd ˋ = o_byj.ˋ();
                                    Context ॱˋ = this.ˋ.ॱˋ();
                                    if (ˋ != null && !ActivityUtil.isAcitivtyNotValid(ॱˋ)) {
                                        evk.ˏ(ॱˋ, j.ˎ, 0).ˋ();
                                        this.ˋ.ˊ(ˋ);
                                    }
                                }
                            }
                        }
                    });
                }
            }
            ˋ = 0;
            o_bya.ˏ(this.ʻˊ, ॱˋ, false, o_byd, ˋ).ˏ(/* anonymous class already generated */);
        }
    }

    private void ˊ(byd o_byd) {
        if (this.ˊʼ != null) {
            for (Fragment fragment : ʽॱ().ˏ()) {
                if (fragment instanceof ForumSectionTabFragment) {
                    String ॱˌ = ((ForumSectionTabFragment) fragment).ॱˌ();
                    if (ॱˌ != null && ॱˌ.startsWith("forum|forum_detail_all")) {
                        break;
                    }
                }
            }
            Fragment fragment2 = null;
            if (fragment2 != null) {
                ForumSectionTabFragment forumSectionTabFragment = (ForumSectionTabFragment) fragment2;
                cia ॱˉ = forumSectionTabFragment.ॱˉ();
                if (ॱˉ instanceof cax) {
                    cax o_cax = (cax) ॱˉ;
                    o_cax.ˊ(o_byd, this.ʻˊ);
                    forumSectionTabFragment.ॱˑ();
                    o_cax.ͺ();
                    forumSectionTabFragment.ˏॱ(0);
                }
            }
            this.ˌॱ.postDelayed(new Runnable(this) {
                final /* synthetic */ ForumSectionDetailFragment ˋ;

                {
                    this.ˋ = r1;
                }

                public void run() {
                    this.ˋ.ʼᐝ.ˋ(this.ˋ.ˉॱ);
                }
            }, 100);
        }
    }

    public void ˎ(TaskFragment taskFragment, List<cvt> list) {
        list.add(new o.brm.e(this.ˏ).ˏ(bsv.ॱ(this.ʻˊ)).ॱ(this.ʼˋ).ॱ());
    }

    public boolean ˋ(TaskFragment taskFragment, com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment.b bVar) {
        if (!ActivityUtil.isAcitivtyNotValid(ॱˋ())) {
            if (ˎ(bVar.ˋ.getResponseCode(), bVar.ˋ.getRtnCode_())) {
                FragmentManager י = י();
                if (י != null) {
                    taskFragment.ॱ(י);
                } else {
                    bqx.ˋ("ForumSectionDetailFragment", "onCompleted manager null");
                }
                if (bVar.ˋ instanceof JGWTabDetailResponse) {
                    JGWTabDetailResponse jGWTabDetailResponse = (JGWTabDetailResponse) bVar.ˋ;
                    this.ʻˊ = jGWTabDetailResponse.ᐝ();
                    this.ʻᐝ = jGWTabDetailResponse.ʻ();
                }
                ॱ(bVar);
                ͺˎ();
                ˋʼ();
                ˊʽ();
            } else {
                ॱ(taskFragment, bVar);
            }
        }
        return false;
    }

    private void ˋʼ() {
        if (this.ʼˊ != null && UserSession.getInstance().isLoginSuccessful()) {
            Section ˊ = this.ʼˊ.ˊ();
            if (ˊ != null) {
                Intent intent = new Intent(ˎ);
                intent.putExtra("section", ˊ);
                ll.ˏ(bqy.ˋ().ˏ()).ˋ(intent);
                ॱ(ˊ);
            }
        }
    }

    private void ˊʽ() {
        Context ॱˋ = ॱˋ();
        if (ॱˋ != null) {
            bqw.ॱ.ˏ(bqy.ˋ().ˎ(ॱˋ), bsv.ॱ(this.ʻˊ).ˎ(), this.ʻˋ);
        } else {
            bqx.ˋ("ForumSectionDetailFragment", "reportVisitSection activity null error");
        }
    }

    private void ॱ(Section section) {
        Activity ॱˋ = ॱˋ();
        if (ॱˋ instanceof ForumSectionDetailActivity) {
            fjf ˊ = fjf.ˊ(ॱˋ);
            ((ISectionDetailActivityResult) ˊ.ॱ()).setSection(section);
            ॱˋ.setResult(-1, ˊ.ˊ());
        }
    }

    private void ॱ(TaskFragment taskFragment, com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment.b bVar) {
        cir o_cir = null;
        if (taskFragment != null) {
            o_cir = (cir) taskFragment.ˊ(cir.class);
        }
        if (ˏ(bVar)) {
            if (o_cir != null) {
                o_cir.a_(8);
            }
            ˋʽ();
            if (this.ˋʽ != null) {
                this.ˋʽ.ˊ(ᐝॱ().getString(j.ˋॱ));
            }
        } else if (o_cir != null) {
            o_cir.ॱ(ˎ(bVar.ˋ), true);
        }
    }

    private void ˋʽ() {
        try {
            FragmentManager י = י();
            if (י != null) {
                Fragment forumSectionClosedFragment = new ForumSectionClosedFragment();
                Bundle bundle = new Bundle();
                bundle.putString("key_css", this.ﹳ);
                bundle.putString("key_cssselector", this.ʹ);
                bundle.putInt("key_style", this.ﾟ);
                forumSectionClosedFragment.ʼ(bundle);
                FragmentTransaction ˊ = י.ˊ();
                ˊ.ˏ(o.cab.e.ꓸ, forumSectionClosedFragment, "ForumSectionDetailFragment");
                ˊ.ˋ();
            }
        } catch (Exception e) {
            bqx.ˋ("ForumSectionDetailFragment", "showSectionClosedFragment exception");
        }
    }

    private boolean ˏ(com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment.b bVar) {
        return bVar.ˋ.getResponseCode() == 0 && bVar.ˋ.getRtnCode_() == 400001;
    }

    private int ˎ(ResponseBean responseBean) {
        int responseCode = responseBean.getResponseCode();
        if (responseCode != 0 || responseBean.getRtnCode_() == 0) {
            return responseCode;
        }
        return 1;
    }

    private void ॱ(com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment.b bVar) {
        if (ॱˋ() != null) {
            this.ʽ = new cay(ॱˋ());
            cay.ˋ(this.ʽ, bVar.ˊ, bVar.ˋ);
            if (this.ᐝ != null) {
                this.ᐝ.ˋ(this.ˊ, this.ʽ);
                return;
            }
            return;
        }
        bqx.ॱ("ForumSectionDetailFragment", "getActivity() is null");
    }

    private void ͺˎ() {
        ˎͺ();
        ˉॱ();
        bre.ॱ.ˊ("time_0001_");
    }

    private void ˎͺ() {
        this.ʼˊ = this.ʽ.ˊ();
        if (this.ʼˊ != null) {
            String str = null;
            if (this.ʼˊ.ˊ() != null) {
                str = this.ʼˊ.ˊ().ˏ();
                this.ʻˋ = this.ʼˊ.ˊ().ˊ();
            }
            if (this.ˋʽ != null) {
                this.ˋʽ.ˏ(str, this.ʻˋ);
            }
        }
        this.ʾॱ = this.ʽ.ˋ();
        if (this.ʾॱ != null) {
            this.ʾॱ.ˊ(this.ʻˋ);
        }
        this.ʽˋ = this.ʽ.ˎ();
        this.ʽᐝ = this.ʽ.ˏ();
    }

    private boolean ˎ(int i, int i2) {
        return i == 0 && i2 == 0;
    }

    public void ᐝ() {
        super.ᐝ();
        try {
            ˈॱ();
        } catch (Exception e) {
            bqx.ˋ("ForumSectionDetailFragment", "onDestroyView error");
        }
    }

    public void onAccountBusinessResult(ccp o_ccp) {
        if (102 == o_ccp.ˎ || 103 == o_ccp.ˎ) {
            bqx.ˊ("ForumSectionDetailFragment", "onAccountBusinessResult, login status: " + o_ccp);
            this.ˌॱ.postDelayed(new b(this), 500);
        }
    }

    private void ˏͺ() {
        if (ActivityUtil.isAcitivtyNotValid(ॱˋ()) || !ʾ()) {
            bqx.ॱ("ForumSectionDetailFragment", "notifyDataChanged, activity is destroy");
        } else if (doo.ˊ(ॱˋ())) {
            ͺˏ();
        } else {
            evk.ˋ(ॱˋ(), ॱ(j.ˈ), 0).ˋ();
        }
    }

    private void ͺˏ() {
        this.ͺˏ = true;
        if (this.ˏͺ != null) {
            if (this.ʽ == null) {
                ˑॱ();
                this.ˏͺ.ˋ(י(), o.cab.e.ꓸ, "ForumSectionDetailFragment-LOADING");
            }
            this.ˏͺ.ॱˋ(false);
            this.ˏͺ.ʾˋ();
            return;
        }
        ʽˊ();
    }

    private void ˑॱ() {
        this.ˈॱ.setVisibility(0);
        this.ॱ.setVisibility(8);
        ᐝ(8);
    }

    public void ˎˎ() {
        eoj.ˋ().ˊ("ForumSectionDetailFragment");
        super.ˎˎ();
    }

    public void ˋ(View view) {
    }

    private void ˎ(View view) {
        if (this.ﹳ != null && this.ʹ != null && view != null) {
            CSSSelector cSSSelector = new CSSSelector(this.ʹ);
            CSSStyleSheet parse = CSSStyleSheet.parse(this.ﹳ);
            if (parse != null) {
                CSSRule rule = cSSSelector.getRule(parse.getRootRule());
                if (rule != null) {
                    CSSView.wrap(view, rule).render();
                }
            }
        }
    }

    public void ˋ(@NonNull Bundle bundle) {
        bundle.putInt("save_bundle_key_lastScroll", this.ˑॱ);
        bundle.putInt("save_bundle_key_lastTab", this.ˎͺ);
        bundle.putString("save_bundle_key_domainId", this.ʻˊ);
        super.ˋ(bundle);
    }

    private FragmentManager י() {
        return ʽॱ();
    }

    public void ˎ(Section section) {
        if (section != null) {
            ॱ(section);
        }
    }
}
